﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
<title>微信付款</title>

<link href="{:_SKIN}/weixin/money/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{:_SKIN}/weixin/money/css/home.css" rel="stylesheet" type="text/css" />

<link href="{:_SKIN}/weixin/money/css/font_6688xdquixljif6r.css" rel="stylesheet" type="text/css" />


</head>

<body>

<!--top-->
<div class="top_c">
    <a  class="iconfont icon-jiantou-copy-copy" ></a>
    <a  class="ming">微信付款</a>
    <p class="titi">记录</p>
</div>


<div class="cong">
	<p>付款金额：<em id="je1"></em></p>
    <div class="zhi">
    	<div class="container">
        	<span>金额</span>
            <input type="number" id="je" name="address"  placeholder="请输入付款金额">
        </div>


    </div>

    <div class="zhi" style="margin-top: 10px">
        <div class="container">
            <span>名称</span>
            <input type="text" id="name" name="address"  placeholder="请输入付款企业名称">
        </div>

        
    </div>
    <div class="container" onclick="pay()">
    	<a  class="deng" style="margin-top:3em;">付款</a>
    </div>
</div>



<script src="{:_SKIN}/weixin/money/js/jquery.min.js" type="text/javascript"></script>

<script src="{:_SKIN}/weixin/money/js/index.js" type="text/javascript"></script>

 <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

    <script type="text/javascript">
         wx.config({$qm|json_encode});

        function pay(){

            var data={

               
               
                je:$("#je").val()
               


            };

            console.log(data);
            if(data.je && data.je>0.01 ){


                $.post("{:url('getje')}", data ,function(res){


                    var  options = res;

                    // 支付成功后的操作
                    options.success = function () {
                         alert('付款成功');
                         window.location.reload();
                    };







                    // 传入参数，发起JSAPI支付
                    wx.chooseWXPay(options);


                });


            }else{

                alert('请将资料输入完整！');
                return false;
            }






        }

        wx.ready(function () {

            wx.hideAllNonBaseMenuItem();

        });

        </script>


</body>
</html>
